import 'package:flutter/material.dart';
import 'package:flutterdemo01/demo3/pages/FirstListPage.dart';

class FirstHomePage extends StatefulWidget {
  const FirstHomePage({Key? key}) : super(key: key);

  @override
  _FirstHomePageState createState() => _FirstHomePageState();
}

class _FirstHomePageState extends State<FirstHomePage> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(primaryColor: Colors.indigo),
      home: Scaffold(
        body: Center(
          child: Column(
            children: [
              SizedBox(
                height: 200,
              ),
              Container(
                width: 200,
                height: 200,
                color: Colors.tealAccent,
                child: Text('首页'),
              ),
              ElevatedButton(
                  onPressed: () {
                     Navigator.of(context).push(
                       MaterialPageRoute(builder: (context) {return FirstListPage();})
                     );
                  },
                  child: Text('跳到列表页面'))

              //   Navigator.of(context).push(
              //               MaterialPageRoute(builder: (context){return SearchPage();})
              //             );
            ],
          ),
        ),
      ),
    );
  }
}
